package club.cearnach.api.dao;

import club.cearnach.entity.Visitor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * @author 阮胜
 * @date 2018/4/2 15:32
 */
public interface IVisitorDao extends JpaRepository<Visitor, Integer> {
    /**
     * 查询今天访客
     * @return
     */
    @Query(value = "select count(1) from visitor where to_days(visit_date) = to_days(now());", nativeQuery = true)
    long findTodayVisitorCount();
}